/**
 * Generate time : 2012-01-09 14:12:57
 * Version : 1.0.1.V20070717
 */
package com.baosight.sczx.zm.ce.domain;

import com.baosight.iplat4j.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.ep.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.util.StringUtils;

/**
 * ZMCEAccessories table comment : 备品配件
 */
public class ZMCEAccessories extends DaoEPBase {

	private String fdKeyId = " "; /* FD_KEY_ID */
	private String fdEquipmentId = " "; /* 对应设备ID */
	private String fdCode = " "; /* 编号 */
	private String fdName = " "; /* 名称 */
	private String fdSpecifications = " "; /* 规格 */
	private String fdModel = " "; /* 型号 */
	private String fdUnit = " "; /* 计量单位 */
	private Long fdQuantity = new Long(0); /* 数量 */
	private String fdIsAccessories = " "; /* 是否备件 */
	private String fdRemarks = " "; /* 备注 */

	/**
	 * initialize the metadata
	 */
	public void initMetaData() {
		EiColumn eiColumn;

		eiColumn = new EiColumn("fdKeyId");
		eiColumn.setPrimaryKey(true);
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("FD_KEY_ID");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdEquipmentId");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("对应设备ID");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdCode");
		eiColumn.setFieldLength(20);
		eiColumn.setDescName("编号");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdName");
		eiColumn.setFieldLength(50);
		eiColumn.setDescName("名称");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdSpecifications");
		eiColumn.setFieldLength(30);
		eiColumn.setDescName("规格");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdModel");
		eiColumn.setFieldLength(30);
		eiColumn.setDescName("型号");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdUnit");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("计量单位");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdQuantity");
		eiColumn.setType("N");
		eiColumn.setScaleLength(0);
		eiColumn.setFieldLength(38);
		eiColumn.setDescName("数量");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdIsAccessories");
		eiColumn.setFieldLength(2);
		eiColumn.setDescName("是否备件");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdRemarks");
		eiColumn.setFieldLength(250);
		eiColumn.setDescName("备注");
		eiMetadata.addMeta(eiColumn);

	}

	/**
	 * the constructor
	 */
	public ZMCEAccessories() {
		initMetaData();
	}

	/**
	 * get the fdKeyId - FD_KEY_ID
	 * 
	 * @return the fdKeyId
	 */
	public String getFdKeyId() {
		return this.fdKeyId;
	}

	/**
	 * set the fdKeyId - FD_KEY_ID
	 */
	public void setFdKeyId(String fdKeyId) {
		this.fdKeyId = fdKeyId;
	}

	/**
	 * get the fdEquipmentId - 对应设备ID
	 * 
	 * @return the fdEquipmentId
	 */
	public String getFdEquipmentId() {
		return this.fdEquipmentId;
	}

	/**
	 * set the fdEquipmentId - 对应设备ID
	 */
	public void setFdEquipmentId(String fdEquipmentId) {
		this.fdEquipmentId = fdEquipmentId;
	}

	/**
	 * get the fdCode - 编号
	 * 
	 * @return the fdCode
	 */
	public String getFdCode() {
		return this.fdCode;
	}

	/**
	 * set the fdCode - 编号
	 */
	public void setFdCode(String fdCode) {
		this.fdCode = fdCode;
	}

	/**
	 * get the fdName - 名称
	 * 
	 * @return the fdName
	 */
	public String getFdName() {
		return this.fdName;
	}

	/**
	 * set the fdName - 名称
	 */
	public void setFdName(String fdName) {
		this.fdName = fdName;
	}

	/**
	 * get the fdSpecifications - 规格
	 * 
	 * @return the fdSpecifications
	 */
	public String getFdSpecifications() {
		return this.fdSpecifications;
	}

	/**
	 * set the fdSpecifications - 规格
	 */
	public void setFdSpecifications(String fdSpecifications) {
		this.fdSpecifications = fdSpecifications;
	}

	/**
	 * get the fdModel - 型号
	 * 
	 * @return the fdModel
	 */
	public String getFdModel() {
		return this.fdModel;
	}

	/**
	 * set the fdModel - 型号
	 */
	public void setFdModel(String fdModel) {
		this.fdModel = fdModel;
	}

	/**
	 * get the fdUnit - 计量单位
	 * 
	 * @return the fdUnit
	 */
	public String getFdUnit() {
		return this.fdUnit;
	}

	/**
	 * set the fdUnit - 计量单位
	 */
	public void setFdUnit(String fdUnit) {
		this.fdUnit = fdUnit;
	}

	/**
	 * get the fdQuantity - 数量
	 * 
	 * @return the fdQuantity
	 */
	public Long getFdQuantity() {
		return this.fdQuantity;
	}

	/**
	 * set the fdQuantity - 数量
	 */
	public void setFdQuantity(Long fdQuantity) {
		this.fdQuantity = fdQuantity;
	}

	/**
	 * get the fdIsAccessories - 是否备件
	 * 
	 * @return the fdIsAccessories
	 */
	public String getFdIsAccessories() {
		return this.fdIsAccessories;
	}

	/**
	 * set the fdIsAccessories - 是否备件
	 */
	public void setFdIsAccessories(String fdIsAccessories) {
		this.fdIsAccessories = fdIsAccessories;
	}

	/**
	 * get the fdRemarks - 备注
	 * 
	 * @return the fdRemarks
	 */
	public String getFdRemarks() {
		return this.fdRemarks;
	}

	/**
	 * set the fdRemarks - 备注
	 */
	public void setFdRemarks(String fdRemarks) {
		this.fdRemarks = fdRemarks;
	}

	/**
	 * get the value from Map
	 */
	@SuppressWarnings("rawtypes")
	public void fromMap(Map map) {

		setFdKeyId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdKeyId")), fdKeyId));
		setFdEquipmentId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdEquipmentId")), fdEquipmentId));
		setFdCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdCode")), fdCode));
		setFdName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdName")), fdName));
		setFdSpecifications(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdSpecifications")), fdSpecifications));
		setFdModel(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdModel")), fdModel));
		setFdUnit(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdUnit")), fdUnit));
		setFdQuantity(NumberUtils.toLong(StringUtils.toString(map.get("fdQuantity")), fdQuantity));
		setFdIsAccessories(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdIsAccessories")), fdIsAccessories));
		setFdRemarks(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdRemarks")), fdRemarks));
	}

	/**
	 * set the value to Map
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map toMap() {

		Map map = new HashMap();
		map.put("fdKeyId", StringUtils.toString(fdKeyId, eiMetadata.getMeta("fdKeyId")));
		map.put("fdEquipmentId", StringUtils.toString(fdEquipmentId, eiMetadata.getMeta("fdEquipmentId")));
		map.put("fdCode", StringUtils.toString(fdCode, eiMetadata.getMeta("fdCode")));
		map.put("fdName", StringUtils.toString(fdName, eiMetadata.getMeta("fdName")));
		map.put("fdSpecifications", StringUtils.toString(fdSpecifications, eiMetadata.getMeta("fdSpecifications")));
		map.put("fdModel", StringUtils.toString(fdModel, eiMetadata.getMeta("fdModel")));
		map.put("fdUnit", StringUtils.toString(fdUnit, eiMetadata.getMeta("fdUnit")));
		map.put("fdQuantity", StringUtils.toString(fdQuantity, eiMetadata.getMeta("fdQuantity")));
		map.put("fdIsAccessories", StringUtils.toString(fdIsAccessories, eiMetadata.getMeta("fdIsAccessories")));
		map.put("fdRemarks", StringUtils.toString(fdRemarks, eiMetadata.getMeta("fdRemarks")));

		return map;

	}
}